import request from "@/request/index.js";
//经纪人获取自己发布的房源列表

export function getAvailability(communityId, rentState, searchValue) {
	return request(`/front/broker/room/list?communityId=${communityId}&rentState=${rentState}&searchValue=${searchValue}`,'get', null)
}

// 获取经纪人已录入房源的小区列表
export function houseAll() {
	return request(`/front/broker/room/community/list`, 'get', null)
}

// 根据房源编号获取房源详情拼接参数

export function HouseDetail(id) {
	return request(`/front/broker/room/detail?houseId=${id}`, 'get', null)
}

// 获取经纪人代录的房源数量
export function getHouseTotal() {
	return request(`/front/broker/room/quantity`, 'get', null)
}
//查询要修改的详情
export function getFindUpdateLease(id) {
	return request(`/front/broker/lease/findUpdateLease/${id}`, 'get', null)
}
//修改租约
export function getUpdateLease(data) {

	return request(`/front/broker/lease/updateLease`, 'post', data)
}

// 批量修改房源出租状态

export function putHouseLeaseSatate(idList) {
	return request(`/front/broker/room/all/${idList}`, 'put', null)
}

//  新增媒体资源列表

export function addMedia(data) {
	return request(`/front/broker/media/all`, 'post', data)
}

// 修改房源信息要先获取房源详情然后修改

export function putDetail(data) {
	return request(`/front/broker/room`, 'put', data)
}

// /front/landlord/lease/house/

export function landlordLeaseHouse(id) {
	return request(`/front/broker/lease/${id}`, 'get', null)
}

// /front/landlord/lease/house/120

export function getHouseLeaseDetail(id) {
	return request(`/front/landlord/lease/house/${id}`, 'get', null)
}

// 删除租约
export function deleteLease(id) {
	return request(`/front/broker/lease/${id}`, 'delete', null)
}

//删除房源
export function deleteHouseRoom(houseId) {
	return request(`/front/landlord/room/delHouseRoom/${houseId}`, 'get', null)
}

//  修改房源的楼栋单元以及室号（门牌号）

export function editHouseDetail(data) {
	return request(`/front/landlord/room/updateHouseBuildUnitVerNumber`, 'post', data)
}